package net.ericaro.neojavagen.expressions;

/**
 * <b>PrimitiveCastExpression</b> ::= "(" <{@link net .ericaro .neojavagen .types .PrimitiveType PrimitiveType}> <{@link net .ericaro .neojavagen .classes .Dims
 * Dims}>? ")" <{@link net .ericaro .neojavagen .expressions .UnaryExpression UnaryExpression}>
 * 
 * @author eric@ericaro.net
 */
public class PrimitiveCastExpression extends net.ericaro.neojavagen.JavaPartComposition {
	private net.ericaro.neojavagen.classes.Dims dims;

	private net.ericaro.neojavagen.types.PrimitiveType primitiveType;

	private net.ericaro.neojavagen.expressions.UnaryExpression unaryExpression;

	public PrimitiveCastExpression(net.ericaro.neojavagen.types.PrimitiveType primitiveType, net.ericaro.neojavagen.classes.Dims dims, net.ericaro.neojavagen.expressions.UnaryExpression unaryExpression) {
		super();
		this.primitiveType = primitiveType;
		this.dims = dims;
		this.unaryExpression = unaryExpression;
	}

	public PrimitiveCastExpression(net.ericaro.neojavagen.types.PrimitiveType primitiveType, net.ericaro.neojavagen.expressions.UnaryExpression unaryExpression) {
		this.primitiveType = primitiveType;
		this.dims = null;
		this.unaryExpression = unaryExpression;
	}

	public net.ericaro.neojavagen.classes.Dims getDims() {
		return dims;
	}

	public net.ericaro.neojavagen.types.PrimitiveType getPrimitiveType() {
		return primitiveType;
	}

	public net.ericaro.neojavagen.expressions.UnaryExpression getUnaryExpression() {
		return unaryExpression;
	}

	public void setDims(net.ericaro.neojavagen.classes.Dims dims) {
		this.dims = dims;
	}

	public void setPrimitiveType(net.ericaro.neojavagen.types.PrimitiveType primitiveType) {
		this.primitiveType = primitiveType;
	}

	public void setUnaryExpression(net.ericaro.neojavagen.expressions.UnaryExpression unaryExpression) {
		this.unaryExpression = unaryExpression;
	}

	@Override
	public java.lang.String toString() {
		return print("(", primitiveType, dims, ")", unaryExpression);
	}
}
